package com.bootdo.hjh.service;

import com.bootdo.hjh.domain.CashPointsDO;
import com.bootdo.hjh.domain.ProductPointsDO;
import com.bootdo.hjh.domain.Withdraw;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface PointsService {

	public Integer cashPointsTotal(Long userId);
	/**
	 * 提现
	 * @param withdraw
	 * @return
	 */
	public Integer withdraw(Withdraw withdraw);
	/**
	 * 商品积分总金额
	 * @param userId
	 * @return
	 */
	public Integer productPointsTotal(Long userId);

	/**
	 * 推荐后成功支付订单后进行积分分账
	 */
	Integer splitPointAfterOrderSuccess(Integer orderId);

	// 补货单发货
	void deliver(Integer orderId);

	/**
	 * 定时任务
	 * 补货单驻留12小时，未发货更改其推荐分润人
	 */
	void orderRetain();

	void shopOrdersplit(Long userId,Long firstRecommendUserId,Long secondRecommendUserId,Integer amount);

	/**
	 * 现金积分明细
	 */
	List<CashPointsDO> listCashPoints(Long userId, Integer type, Date beginDate,Date endDate, Integer offset, Integer
			limit);

	int countCashPoint(Long userId,Integer type, Date beginDate,Date endDate);

	/**
	 * 商品积分明细
	 */
	List<ProductPointsDO> listProductPoints(Long userId, Integer type, Date beginDate,Date endDate, Integer offset, Integer
			limit);

	int countProductPoint(Long userId,Integer type, Date beginDate,Date endDate);

	/**
	 * 现金积分转账
	 */
	int cashPointTransfer(Long fromUserId,String fromUsername,String toUsername,String toRealname,Integer amount);

	/**
	 * 商品积分转账
	 * @param fromUserId
	 * @param toRealname
	 * @param amount
	 * @return
	 */
	int productPointTransfer(Long fromUserId,String fromUsername,String toUsername,String toRealname,Integer amount);
	/**
	 * VIP 分红
	 * VIP会员每周享受平台新增业绩的5%分红，每周一结算，累计给予一年分红。
			其中60%为现金积分，40%为商品积分。最低提现金额为100元
	 *
	 */
	public void vipBonus();
	/**
	 * 代理商每周将获得公司新增业绩的2%作为平台管理奖励

	 */
	public void agentBonus();


	/**
	 * 统计初级合伙人

	 */
	public void agent2Bonus();

	/**
	 * 统计中级合伙人

	 */
	public void agent3Bonus();

	/**
	 * 统计高级合伙人

	 */
	public void agent4Bonus();

	/**
	 * 统计联合创始人

	 */
	public void agent5Bonus();

	public List<Integer> reportIncome(String startDate,String endDate);

	public List<Integer> reportExpend(String startDate,String endDate);

	public List<Integer> reportIncomeMonth(String startDate,String endDate);

	public List<Integer> reportExpendMonth(String startDate,String endDate);

	public Map<String, Double> amountSum();


}
